#! /usr/bin/env python
#coding=utf-8
from LinkSQL import LogSQL
import time

class InitReproduce:
    
    def __init__(self):
        pass

    def Init(self):
        sql = LogSQL()
        db = "create database sql_log;";
        sql.SQLQuery(db)
        sql.Commit()
        sql.DBClose()

    def CreateTabLog(self, tn):
        
        table = "CREATE TABLE IF NOT EXISTS `sql_log_%d` (  \
                `id` bigint(20) NOT NULL AUTO_INCREMENT,   \
                `sql` text NOT NULL DEFAULT '',   \
                PRIMARY KEY (`id`)   \
                ) DEFAULT CHARSET=utf8 ;"%tn
        print table
        #sql = LogSQL()
        #sql.SQLQuery(table)
        #sql.Commit()
        #sql.DBClose()
    
if __name__ == '__main__':
    i = InitReproduce()
    #i.Init()
    tn = time.strftime('%Y%U', time.localtime())
    for n in range(56):
        tn = int(tn)
        i.CreateTabLog(tn+n)
    
    